#!/usr/bin/make -f

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

LDFLAGS += -lCoinUtils -lCgl -lOsi -lOsiClp
DEB_CONFIGURE_EXTRA_FLAGS += --enable-static CPPFLAGS=-I/usr/include/coin
DEB_INSTALL_DOCS_ALL = ./SYMPHONY/AUTHORS ./SYMPHONY/README
DEB_CLEAN_EXCLUDE = .orig
DEB_COMPRESS_EXCLUDE = .pdf .h .c .spp Makefile README

build/coinor-libsymphony-doc:: debian/stamp-build-coinor-libsymphony-doc

debian/stamp-build-coinor-libsymphony-doc:
	cd SYMPHONY/Doc && ( latex man ; latex man ; dvipdfm man )
	touch $@

install/coinor-libsymphony-doc:: debian/stamp-install-coinor-libsymphony-doc

debian/stamp-install-coinor-libsymphony-doc:
	mkdir -p debian/coinor-libsymphony-doc/usr/share/doc/coinor-libsymphony-doc/
	cp SYMPHONY/Doc/man.pdf \
		debian/coinor-libsymphony-doc/usr/share/doc/coinor-libsymphony-doc/user-guide.pdf
	touch $@

get-orig-source:
	-uscan --rename --upstream-version 0
	@echo successfully retrieved upstream tarball

clean::
	$(RM) Makefile config.status config.log debian/stamp-*
	$(RM) SYMPHONY/Doc/man.aux SYMPHONY/Doc/man.dvi \
	      SYMPHONY/Doc/man.idx SYMPHONY/Doc/man.log \
	      SYMPHONY/Doc/man.out SYMPHONY/Doc/man.pdf \
	      SYMPHONY/Doc/man.toc
